package com.coin.controller;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.coin.domain.SysUserLog;
import com.coin.model.R;
import com.coin.service.SysUserLogService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @Auther: 李 力
 * @Date: 2025/5/28
 * @Description: com.coin.controller
 * @version: 1.0
 */
@RestController
@Api(tags = "用户的操作记录查询")
@RequestMapping("/sysUserLog")
public class SysUserLogController {

    @Autowired
    private SysUserLogService userLogService;

    /**
     * @Description: 分页查询用户的操作记录
     * @Author: 李 力
     * @Date: 2025/5/28
     * @Param: Page
     * @return: R
     */
    @GetMapping
    @ApiOperation(value = "分页查询用户的操作记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page", value = "分页查询")
    })
    public R<Page<SysUserLog>> findByPage(@ApiIgnore Page<SysUserLog> page) {
        page.addOrder(OrderItem.desc("created"));
        return R.ok(userLogService.page(page));
    }


}
